<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'pesanan-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php if(false){echo $form->labelEx($model,'ID_Pesanan');} ?>
		<?php if(false){echo $form->textField($model,'ID_Pesanan',array('size'=>20,'maxlength'=>20,'disabled'=>true));} ?>
		<?php if(false){echo $form->error($model,'ID_Pesanan');} ?>
	</div>

        <div class="row">
		<?php echo $form->labelEx($model,'Tgl_Pesanan'); ?>
		<p><?php echo $form->textField($model,'Tgl_Pesanan');?>   Format : DD-MM-YYYY</p>
		<?php echo $form->error($model,'Tgl_Pesanan'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Asal'); ?>
		<?php echo $form->dropDownlist($model,'Asal',$model->getAsal(),array('submit'=>'','params'=>array('asal'=>'asal'))); ?>
		<?php echo $form->error($model,'Asal'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'Tujuan'); ?>
		<?php echo $form->dropDownlist($model,'Tujuan',($model->Asal == null)?$model->getTujuan():$model->getTujuan($model->Asal),array('submit'=>'','params'=>array('asal'=>'asal'))); ?>
		<?php echo $form->error($model,'Tujuan'); ?>
	</div>
        
	<div class="row">
		<?php echo $form->labelEx($model,'Jam_Keberangkatan'); ?>
		<?php echo $form->dropDownlist($model,'Jam_Keberangkatan',$model->getJamKeberangkatan(), array('submit'=>'','params'=>array('asal'=>'asal'))); ?>
		<?php echo $form->error($model,'Jam_Keberangkatan'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'No_tempat_duduk'); ?>
		<?php echo $form->dropDownList($model,'No_tempat_duduk',$model->getTempatDuduk($model->Tgl_Pesanan, $model->Asal, $model->Tujuan, $model->Jam_Keberangkatan)); ?>
		<?php echo $form->error($model,'No_tempat_duduk'); ?>
	</div>

	<div class="row">
		<?php if(Yii::app()->user->isCSO())echo $form->labelEx($model,'Username'); ?>
		<?php if(Yii::app()->user->isCSO())echo $form->textField($model,'Username',array('size'=>10,'maxlength'=>10)); ?>
		<?php if(Yii::app()->user->isCSO())echo $form->error($model,'Username'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Pesan' : 'Simpan'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->